﻿using EventModel;
using MassTransit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ExamEventBus
{
    public class ExamEventHandler : IConsumer<IMessage>
    {
        public IEventRepository EventRepository { get; }

        public ExamEventHandler(IEventRepository EventRepository)
        {
            this.EventRepository = EventRepository;
        }

        public async Task Consume(ConsumeContext<IMessage> context)
        {
            var eventResult = await EventRepository.UpdateEventStatus(context.Message);
        }
    }
}
